namespace EzDeploy.Core
{
    public class BindingRedirect
    {
        readonly string _name;
        readonly string _publicKeyToken;
        readonly string _culture;
        readonly string _oldVersion;
        readonly string _newVersion;
        readonly bool _publisherPolicy;

        public string Name
        {
            get
            {
                return _name;
            }
        }

        public string PublicKeyToken
        {
            get
            {
                return _publicKeyToken;
            }
        }

        public string Culture
        {
            get
            {
                return _culture;
            }
        }

        public string OldVersion
        {
            get
            {
                return _oldVersion;
            }
        }

        public string NewVersion
        {
            get
            {
                return _newVersion;
            }
        }

        public bool PublisherPolicy
        {
            get
            {
                return _publisherPolicy;
            }
        }

        public BindingRedirect(string name, string publicKeyToken, string culture, string oldVersion, string newVersion, bool publisherPolicy)
        {
            _name = name;
            _publicKeyToken = publicKeyToken;
            _culture = culture;
            _oldVersion = oldVersion;
            _newVersion = newVersion;
            _publisherPolicy = publisherPolicy;
        }

        public override string ToString()
        {
            return string.Format("{0}, Version={1}, Culture={2}, PublicKeyToken={3}", _name, _oldVersion, _culture, string.IsNullOrEmpty(_publicKeyToken) ? "null" : _publicKeyToken);
        }
    }
}
